<template>
  <div class="about">
    <h1>This is an about page</h1>
    <!-- 在about页面。跳转到home页面 -->
    <button @click="handleRouterClick">跳转到home页面</button>
  </div>
</template>
<script>
export default {
  created() {
    console.log('title', this.$route.meta.title)
    document.title = this.$route.meta.title
  },
  methods: {
    handleRouterClick() {
      // console.log(this, 'this是vue的实例')
      // // 获取当前的页面的路由信息
      // console.log('路由信息：', this.$route)
      // console.log('路由方法:', this.$router)
      // this.$router.push('/detail/2')
      // this.$router.push({ path: '/layout/home/homeA' })
      // this.$router.push({ name: 'HomeA', params: { age: 123 } })

      // query url?name=123&age=123
      this.$router.push({ path: '/layout/home/homeA', query: { name: 'private', age: 123 } })
    },
  },
}
</script>
